package com.xhs.main.service.xsb.impl;

import com.xhs.main.dao.xsb.XsbInvoiceDao;
import com.xhs.main.entity.xsb.Invoice;
import com.xhs.main.service.xsb.XsbInvocieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hjr
 * @create 2020-10-16-上午 9:57
 */
@Service
public class XsbInvoiceServiceImpl implements XsbInvocieService {

    @Autowired
    XsbInvoiceDao  xsbInvoiceDao;


    @Override
    public void addInvocie(Invoice invoice) {
        xsbInvoiceDao.insertInvoice(invoice);
    }

    @Override
    public List<Invoice> getAllInvoice() {
        List<Invoice> allInvoice = xsbInvoiceDao.getAllInvoice();
        return allInvoice;
    }

    @Override
    public List<Invoice> getAllInvoiceByVague(Invoice invoice) {
        xsbInvoiceDao.selectAllInvoiceByVagueInv(invoice);
        return null;
    }

    @Override
    public List<Invoice> updateInvoice(Invoice invoice) {
        xsbInvoiceDao.updateInvoice(invoice);
        List<Invoice> allInvoice = xsbInvoiceDao.getAllInvoice();
        return allInvoice;
    }
}
